﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QiAdmin.Core.Models
{
    public class StaticData
    {
        public StaticData() { }

        public readonly string[] DataRangs = typeof(DataRang).GetFields().Select(s => (string)s.GetValue(null)).ToArray();

        public readonly string[] PermissionTypes = Enum.GetNames(typeof(PermissionType));

        #region CacheKey
        public readonly string CacheKey_Dept = "Sys_DeptCache";
        public readonly string CacheKey_Dict = "Sys_DictCache";
        public readonly string CacheKey_Role = "Sys_RoleCache";
        public readonly string CacheKey_RoleMenu = "Sys_RoleMenuCache";

        public readonly string CacheKey_CheckToken = "CheckToken_";
        #endregion

        /// <summary>
        /// 定时任务的程序集
        /// </summary>
        public readonly string TaskAssembly = "QiAdmin.Tasks";

        /// <summary>
        /// 上传文件的保存地址
        /// </summary>
        public readonly string UploadPath = AppDomain.CurrentDomain.BaseDirectory+ "Files/Upload";

        public int SystemId = 1;
        public int SystemDept = 1;
        public int SystemRole = 1;
    }
    public enum PermissionType
    {
        System,
        Add,
        Edit,
        Query,
        Delete,
        Audit,
        Other
    }

    public struct DataRang
    {
        public const string All = "全部";
        public const string Dept = "本部门";
        public const string DeptAndBelow = "本部门及以下";
        public const string Self = "仅本人";
        public const string Custom = "自定义";
    }
}
